<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <style type="text/css">
		#showtimex{
			background-image: url(img7/cald.png);
			color: #F0F8FF;
			
		}
       #showtime{
            background-image: url("img7/clock.png");
			color: #F0F8FF;
			line-height: 150px;
        }
    </style>
</head>
<body>
<button id="btn3">当前日期</button>
<h1 id="showtimex" style="border: #000000 0.1px solid;width: 150px;text-align: center; height: 140px;" ></h1>
<h1 id="showtime" style="border: #000000 0.1px solid;width: 150px;text-align: center; height: 150px;" ></h1>
</body>
</html>
<script>
	//唐杰 179000950
    document.querySelector("#btn3").addEventListener("click",function(){
        //
        // setInterval(show2,1000);
        show1();
		show2();
		show3();
    })
    function show1(){
        var mytime = new Date();
        var h =mytime.getHours();
        var m =mytime.getMinutes();
        var s =mytime.getSeconds();
        var str = `${h}:${m}:${s}`;
        document.querySelector("#showtime").innerHTML = str;
        setTimeout(show1,1000);
    }
	
	function show2(){
		var now = new Date();
		var day = now.getDay();
		var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
		var week = weeks[day];
		document.querySelector("#showtimex").innerHTML = week;
	}
	
	function show3(){
		var date =new Date();
		var day =date.getDate();
		document.querySelector("#showtimex").innerHTML = day;
	}
	
	// function getWeekDate() {
	// 	   var now = new Date();
	// 	   var day = now.getDay();
	// 	   var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
	// 	   var week = weeks[day];
	// 	   return week;
	// 	}
	// 	alert(getWeekDate()).
	
	
</script>